package com.ruoyi.service.tourism.impl;

import com.ruoyi.mapper.tourism.BusinessBbMapper;
import com.ruoyi.mapper.tourism.BusinessCzMapper;
import com.ruoyi.service.tourism.BusinessBbService;
import com.ruoyi.service.tourism.BusinessCzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author zeo
 * @explain 滁州蚌埠模块
 * @date 2021/2/2 9:45
 */
@Service
public class BusinessBbServiceImpl implements BusinessBbService {

    @Autowired
    BusinessBbMapper businessBbMapper;

    @Override
    public List<Map<String, Object>> findBusinessBbMonthList(Map map) {
        return businessBbMapper.findBusinessBbMonthList(map);
    }

    @Override
    public List<Map<String, Object>> findBusinessBbDayList(Map map) {
        return businessBbMapper.findBusinessBbDayList(map);
    }

    @Override
    public int addBusinessBb(Map map) {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        map.put("foreignId", uuid);
        businessBbMapper.addShare(map);
        return businessBbMapper.addBusinessBb(map);
    }

    @Override
    public Map findBusinessBbById(String id) {
        return businessBbMapper.findBusinessBbById(id);
    }

    @Override
    public int editBusinessBb(Map map) {
        return businessBbMapper.editBusinessBb(map) + businessBbMapper.editShare(map);
    }

    @Override
    public Map getLastDayData(Map map) {
        return businessBbMapper.getLastDayData(map);
    }
}
